<template>
	<view class="" style="background-color: #d70127;">
		<view class="content">
			<view class="staffmode">
				<view class="stafflist" v-for="(item,indexc) in mainData" :key="indexc">
					<view class="infodata">
						<view class="df-sb">
							<view class="df-flex">
								<image :src="item.image" mode=""
									style="width: 150rpx;height: 150rpx;border-radius: 50%;">
								</image>
								<view class=""
									style="margin-left: 20rpx;display: flex;flex-direction: column;justify-content: center;">
									<view class="">
										{{item.name}}
									</view>
									<view class="" style="margin-top: 20rpx;">
										{{item.address}}
									</view>
									<view class="" style="margin-top: 20rpx;" v-if="item.remark"> 备注：{{item.remark}}
									</view>
								</view>
							</view>
							<view class="" style="" v-if="item.status==0"> 待审核 </view>
							<view class="" style="" v-if="item.status==1"> 已驳回 </view>
							<view class="" style="" v-if="item.status==2"> 通过 </view>
						</view>
						<view class="time" style="margin-top: 20rpx;text-align: right;">
							{{item.createTime}}
						</view>
					</view>
				</view>
				<!-- 	<view class="" v-if="isEmpty" style="display: flex;justify-content: center;margin-top: 300rpx;">
					<image src="/static/image/empty.png" mode="widthFix" style="width: 500rpx;"></image>
				</view> -->
			</view>
		</view>
	</view>
</template>
<script>
	import {
		getApplyList
	} from '../request/api.js'
	export default {
		data() {
			return {
				mainData: [],
				isEmpty: true,
				pageNo: 1,
				total: '',
			};
		},
		onLoad() {
			this.getApplyListMethod();
		},
		onReachBottom() {
			if (this.total <= this.mainData.length) {
				uni.showToast({
					title: '已加载全部数据',
					icon: "none"
				});
			} else {
				this.pageNo++;
				this.getApplyListMethod()
			}
		},
		methods: {
			getApplyListMethod() {
				getApplyList({
					pageNo: this.pageNo,
					userId: uni.getStorageSync('userInfo').id,
				}).then(res => {
					if (res.code == 200) {
						this.mainData = [...this.mainData, ...res.result.records]
						this.total = res.result.total; //数据总条数
						if (this.mainData.length > 0) {
							this.isEmpty = false
						} else {
							this.isEmpty = true
						}
					}
				})
			},
		}
	}
</script>
<style lang="scss" scoped>
	.content {
		padding-top: 50rpx;
		min-height: 100vh;
		background: url('/static/image/bg2.png') no-repeat center center;
		background-size: 100% 100%;

		.tabs {
			display: flex;
			justify-content: space-around;
			padding: 50rpx 30rpx 20rpx;
			box-sizing: border-box;
			position: fixed;
			top: 0;
			left: 0;
			width: 100%;
			background-color: #252026;
			z-index: 9999;
			color: #FDE8CE;

			.tablist {
				position: relative;
			}

			.active::after {
				position: absolute;
				bottom: -10rpx;
				width: 76rpx;
				height: 4rpx;
				content: " ";
				border-radius: 2rpx;
				background: #FDE8CE;
				left: 9rpx;
			}
		}

		.staffmode {
			// background: #fff;
			padding: 20rpx;
			border-radius: 20rpx;
			min-height: 200rpx;

			.stafflist {
				display: flex;
				position: relative;
				padding: 30rpx 0;
				border-bottom: 1rpx solid #f1f1f1;
				color: #FDE8CE;

				image {
					width: 118rpx;
					height: 118rpx;
					border-radius: 50%;
				}

				.infodata {
					margin-left: 10rpx;
					width: 100%;

					// width: 550rpx;
					.name {
						font-size: 40rpx;

						.phone {
							font-size: 36rpx;
							margin-left: 20rpx;
						}
					}

					.time {
						font-size: 36rpx;
						margin-top: 10rpx;
					}
				}

				.number {
					position: absolute;
					right: 0;
					font-size: 40rpx;
					padding-top: 20rpx;
				}
			}
		}
	}
</style>